/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mas.client;

import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.Properties;
import mas.shared.Request;
import mas.shared.RequestCommand;
import mas.shared.Response;
import mas.shared.impl.RequestImpl;
import mas.shared.utils.RequestHandler;
import mas.shared.utils.Utils;

/**
 *  This ist the agent
 * @author liese
 */
public class Agent
{

    public static void main(String[] args) throws Exception
    {
        System.err.println("Agent running.");
        
        Properties agentProps = Utils.loadPropertiesFile("agent.properties");
        
        String serverMainHost = agentProps.getProperty("server.main.host");
        int serverMainPort = Integer.parseInt(agentProps.getProperty("server.main.port"));
        
        RequestHandler rh = new RequestHandler(serverMainHost, serverMainPort);
        
        Request req = new RequestImpl(RequestCommand.requestTask);
        Response res = rh.sendRequest(req);
        
        Request req2 = new RequestImpl(RequestCommand.provideSolution);
        Response res2 = rh.sendRequest(req2);
        
    }
}
